/*
2023.04.26
依赖browserify组件，从npm库里打包生成浏览器可执行的js。
当然的，io，网络等浏览器不支持的特性，都要先剔除
ethers.js和browserify并不很兼容，其“#”定义的私有域变量和方法无法输出
操作步骤：
* npm install -g browserify
* cd utils
* browserify utils_exports.js -o bcosutils.js --s bcosutils
* */

const bcostars = require("../tars/TransactionTars").bcostars;
const TxUtils = require("./tx_utils").TxUtils;
const DataUtils = require("./data_utils").DataUtils;

/*
var abiStr = '[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"newname","type":"string"}],"name":"onset","type":"event"},{"inputs":[],"name":"get","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"n","type":"string"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"}]';
var txData = new bcostars.TransactionData();
console.log("txdata:",txData);
var privkey = "255f01b066a90853a0aa18565653d7b944cd2048c03613a9ff31cb9df9e693e5";
var rawtxbin = TxUtils.build_rawtransaction_by_txdata(txData,privkey);
var rawtxhex = DataUtils.arrayToHex(rawtxbin);
console.log("rawtxhex",rawtxhex);
module.exports.rawtxhex = rawtxhex;
module.exports.abiStr = abiStr;

*/



module.exports.bcostars = bcostars;
module.exports.TxUtils = TxUtils;
module.exports.DataUtils = DataUtils;


